from PyQt6.QtWidgets import QApplication, QMainWindow, QMessageBox

import crsky
import thread
from spider import Ui_spider_main

# 主窗口类
class MyMainWindow(QMainWindow, Ui_spider_main):
    def __init__(self):
        super().__init__()
        self.setupUi(self)


if __name__ == "__main__":
    import sys

    app = QApplication(sys.argv)
    window = MyMainWindow()
    try:
        window.show()
        window.submit.clicked.connect(lambda: thread.start_task(window))
        sys.exit(app.exec())
    except Exception as e:
        print("程序错误: " + str(e))
